package com.hnucm.house.adapter;

import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hnucm.house.R;
import com.hnucm.house.bean.NewHouseData;

import java.util.List;

public class NewHouseAdapter extends BaseQuickAdapter<NewHouseData.DataDTO, BaseViewHolder> {
    private Context mContext;

    public NewHouseAdapter(List<NewHouseData.DataDTO> list, Context context) {
        super(R.layout.item_new_house,list);
        mContext = context;
    }
    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, NewHouseData.DataDTO dataDTO) {
        baseViewHolder.setText(R.id.houseName,dataDTO.getName());
        Glide.with(mContext)
                .load(dataDTO.getPic())
                .into((ImageView) baseViewHolder.getView(R.id.housePic));
    }
}
